﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true"
    CodeFile="agent-daily-leads.aspx.cs" Inherits="telereport_agent_daily_leads" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager runat="server" ID="smgrUser" EnablePartialRendering="true">
    </asp:ScriptManager>
    <div class="contents">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td>
                    <h1>
                        Agent Daily Leads</h1>
                </td>
            </tr>
            <asp:UpdatePanel ID="updOption" UpdateMode="Conditional" runat="server">
                <ContentTemplate>
                    <tr id="trSearch" runat="server">
                        <td>
                            <b>Report Type</b> :
                            <asp:DropDownList ID="ddlReportType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlReportType_SelectedIndexChanged">
                                <%--<asp:ListItem Value="0">Monthly</asp:ListItem>--%>
                                <asp:ListItem Value="1" Selected="True">Daily</asp:ListItem>
                                <%--<asp:ListItem Value="2">Customize</asp:ListItem>--%>
                            </asp:DropDownList>
                            &nbsp; <b>
                                <asp:Label ID="lblFromDate" runat="server"></asp:Label></b>
                            <asp:DropDownList ID="ddlDay1" runat="server" ToolTip="Choose Day">
                                <asp:ListItem Value="01">01</asp:ListItem>
                                <asp:ListItem Value="02">02</asp:ListItem>
                                <asp:ListItem Value="03">03</asp:ListItem>
                                <asp:ListItem Value="04">04</asp:ListItem>
                                <asp:ListItem Value="05">05</asp:ListItem>
                                <asp:ListItem Value="06">06</asp:ListItem>
                                <asp:ListItem Value="07">07</asp:ListItem>
                                <asp:ListItem Value="08">08</asp:ListItem>
                                <asp:ListItem Value="09">09</asp:ListItem>
                                <asp:ListItem Value="10">10</asp:ListItem>
                                <asp:ListItem Value="11">11</asp:ListItem>
                                <asp:ListItem Value="12">12</asp:ListItem>
                                <asp:ListItem Value="13">13</asp:ListItem>
                                <asp:ListItem Value="14">14</asp:ListItem>
                                <asp:ListItem Value="15">15</asp:ListItem>
                                <asp:ListItem Value="16">16</asp:ListItem>
                                <asp:ListItem Value="17">17</asp:ListItem>
                                <asp:ListItem Value="18">18</asp:ListItem>
                                <asp:ListItem Value="19">19</asp:ListItem>
                                <asp:ListItem Value="20">20</asp:ListItem>
                                <asp:ListItem Value="21">21</asp:ListItem>
                                <asp:ListItem Value="22">22</asp:ListItem>
                                <asp:ListItem Value="23">23</asp:ListItem>
                                <asp:ListItem Value="24">24</asp:ListItem>
                                <asp:ListItem Value="25">25</asp:ListItem>
                                <asp:ListItem Value="26">26</asp:ListItem>
                                <asp:ListItem Value="27">27</asp:ListItem>
                                <asp:ListItem Value="28">28</asp:ListItem>
                                <asp:ListItem Value="29">29</asp:ListItem>
                                <asp:ListItem Value="30">30</asp:ListItem>
                                <asp:ListItem Value="31">31</asp:ListItem>
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlMonth1" runat="server">
                                <asp:ListItem Value="01">Jan</asp:ListItem>
                                <asp:ListItem Value="02">Feb</asp:ListItem>
                                <asp:ListItem Value="03">Mar</asp:ListItem>
                                <asp:ListItem Value="04">Apr</asp:ListItem>
                                <asp:ListItem Value="05">May</asp:ListItem>
                                <asp:ListItem Value="06">Jun</asp:ListItem>
                                <asp:ListItem Value="07">Jul</asp:ListItem>
                                <asp:ListItem Value="08">Aug</asp:ListItem>
                                <asp:ListItem Value="09">Sep</asp:ListItem>
                                <asp:ListItem Value="10">Oct</asp:ListItem>
                                <asp:ListItem Value="11">Nov</asp:ListItem>
                                <asp:ListItem Value="12">Dec</asp:ListItem>
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlYear1" runat="server">
                                <asp:ListItem Value="2010">2010</asp:ListItem>
                                <asp:ListItem Value="2011">2011</asp:ListItem>
                                <asp:ListItem Value="2012">2012</asp:ListItem>
                                <asp:ListItem Value="2013">2013</asp:ListItem>
                            </asp:DropDownList>
                            <b>
                                <asp:Label ID="lblToDate" runat="server"></asp:Label></b>
                            <asp:DropDownList ID="ddlDay2" runat="server" ToolTip="Choose Day">
                                <asp:ListItem Value="01">01</asp:ListItem>
                                <asp:ListItem Value="02">02</asp:ListItem>
                                <asp:ListItem Value="03">03</asp:ListItem>
                                <asp:ListItem Value="04">04</asp:ListItem>
                                <asp:ListItem Value="05">05</asp:ListItem>
                                <asp:ListItem Value="06">06</asp:ListItem>
                                <asp:ListItem Value="07">07</asp:ListItem>
                                <asp:ListItem Value="08">08</asp:ListItem>
                                <asp:ListItem Value="09">09</asp:ListItem>
                                <asp:ListItem Value="10">10</asp:ListItem>
                                <asp:ListItem Value="11">11</asp:ListItem>
                                <asp:ListItem Value="12">12</asp:ListItem>
                                <asp:ListItem Value="13">13</asp:ListItem>
                                <asp:ListItem Value="14">14</asp:ListItem>
                                <asp:ListItem Value="15">15</asp:ListItem>
                                <asp:ListItem Value="16">16</asp:ListItem>
                                <asp:ListItem Value="17">17</asp:ListItem>
                                <asp:ListItem Value="18">18</asp:ListItem>
                                <asp:ListItem Value="19">19</asp:ListItem>
                                <asp:ListItem Value="20">20</asp:ListItem>
                                <asp:ListItem Value="21">21</asp:ListItem>
                                <asp:ListItem Value="22">22</asp:ListItem>
                                <asp:ListItem Value="23">23</asp:ListItem>
                                <asp:ListItem Value="24">24</asp:ListItem>
                                <asp:ListItem Value="25">25</asp:ListItem>
                                <asp:ListItem Value="26">26</asp:ListItem>
                                <asp:ListItem Value="27">27</asp:ListItem>
                                <asp:ListItem Value="28">28</asp:ListItem>
                                <asp:ListItem Value="29">29</asp:ListItem>
                                <asp:ListItem Value="30">30</asp:ListItem>
                                <asp:ListItem Value="31">31</asp:ListItem>
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlMonth2" runat="server">
                                <asp:ListItem Value="01">Jan</asp:ListItem>
                                <asp:ListItem Value="02">Feb</asp:ListItem>
                                <asp:ListItem Value="03">Mar</asp:ListItem>
                                <asp:ListItem Value="04">Apr</asp:ListItem>
                                <asp:ListItem Value="05">May</asp:ListItem>
                                <asp:ListItem Value="06">Jun</asp:ListItem>
                                <asp:ListItem Value="07">Jul</asp:ListItem>
                                <asp:ListItem Value="08">Aug</asp:ListItem>
                                <asp:ListItem Value="09">Sep</asp:ListItem>
                                <asp:ListItem Value="10">Oct</asp:ListItem>
                                <asp:ListItem Value="11">Nov</asp:ListItem>
                                <asp:ListItem Value="12">Dec</asp:ListItem>
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlYear2" runat="server">
                                <asp:ListItem Value="2010">2010</asp:ListItem>
                                <asp:ListItem Value="2011">2011</asp:ListItem>
                                <asp:ListItem Value="2012">2012</asp:ListItem>
                                <asp:ListItem Value="2013">2013</asp:ListItem>
                            </asp:DropDownList>
                            <div style="display: none">
                                <asp:TextBox ID="txtReportType" runat="server"></asp:TextBox>
                                <asp:TextBox ID="txtReportDate1" runat="server"></asp:TextBox>
                                <asp:TextBox ID="txtReportDate2" runat="server"></asp:TextBox>
                                <asp:TextBox ID="txtIsUpdated" runat="server" Text="0"></asp:TextBox>
                                <asp:TextBox runat="server" ReadOnly="true" ID="txtAgentId"></asp:TextBox>
                                <asp:Label ID="lblContent" runat="server"></asp:Label>
                            </div>
                            &nbsp;<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit" />&nbsp;
                            <asp:Label ID="lblRecordCount" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
                            <asp:GridView ID="grvAgentLeads" runat="server" AutoGenerateColumns="False" CellSpacing="3"
                                CellPadding="3" Width="100%" CssClass="admin_gridstyle" PagerStyle-CssClass="pgr"
                                EmptyDataText="There are no data records to display." GridLines="None" DataKeyNames="AgentId">
                                <Columns>
                                    <asp:BoundField DataField="AgentId" HeaderText="Agent Id" SortExpression="AgentId" />
                                    <asp:BoundField DataField="AgentCode" HeaderText="Agent Code" SortExpression="AgentCode" />
                                    <asp:TemplateField HeaderText="Agent Name">
                                        <ItemTemplate>
                                            <asp:Label ID="lblAgentName" runat="server" Text='<%# GetAgentName(Eval("AgentNameTH").ToString(),Eval("AgentNameEN").ToString()) %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="NewLeads" HeaderText="New Leads" SortExpression="NewLeads" />
                                    <asp:BoundField DataField="OldLeads" HeaderText="Old Leads" SortExpression="OldLeads" />
                                    <asp:BoundField DataField="TotalLeads" HeaderText="Total Assigned" SortExpression="TotalLeads" />
                                    <asp:BoundField DataField="UsedLeads" HeaderText="Used Leads" SortExpression="UsedLeads" />
                                    <asp:BoundField DataField="LeadDate" HeaderText="Leads Assigned Date" SortExpression="LeadDate" />
                                </Columns>
                                <%--<Columns>
                                    <asp:BoundField DataField="AgentId" HeaderText="Agent Id" SortExpression="AgentId" />
                                    <asp:BoundField DataField="AgentName" HeaderText="Agent Name" SortExpression="AgentName" />
                                    <asp:BoundField DataField="AgentCode" HeaderText="Agent Code" SortExpression="AgentCode" />
                                    <asp:BoundField DataField="LeadAssign7AM" HeaderText="Auto Leads at 7AM" SortExpression="LeadAssign7AM" />
                                    <asp:BoundField DataField="LeadAssign2Hr" HeaderText="Leads Every 2Hr" SortExpression="LeadAssign2Hr" />
                                    <asp:BoundField DataField="LeadfromCB" HeaderText="Leads from CB" SortExpression="LeadfromCB" />
                                     <asp:BoundField DataField="TotalAssign" HeaderText="Total Assigned" SortExpression="TotalAssign" />
                                     <asp:BoundField DataField="TotalContact" HeaderText="Total Contacted" SortExpression="TotalContact" />
                                     <asp:BoundField DataField="TotalUnContact" HeaderText="Total UnContacted" SortExpression="TotalUnContact" />
                                     <asp:BoundField DataField="LeadsDate" HeaderText="Leads Aggigned Date" SortExpression="LeadsDate" DataFormatString="{0:dd/MMM/yyyy}"  />                                      
                                </Columns>--%>
                                <FooterStyle />
                                <PagerStyle />
                                <SelectedRowStyle />
                                <HeaderStyle CssClass="admin_gridheader" />
                                <EditRowStyle />
                                <AlternatingRowStyle CssClass="admin_gridodd" />
                                <RowStyle CssClass="admin_grideven" />
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr id="trRecordCount" runat="server">
                        <td>
                            <div id="divLegend" runat="server">
                                <%--<span style='color: #8A0808; font-size: 14px; font-weight: bold;'>&nbsp;&nbsp;TOTAL:&nbsp;</span>--%>
                                <span style='color: #B4045F; font-size: 14px; font-weight: bold;'>
                                    &nbsp;&nbsp;NEW LEADS :&nbsp;
                                    <asp:Label ID="lblNewLeads" runat="server"></asp:Label>&nbsp;&nbsp;
                                </span>| 
                                <span style='color: #04B404; font-size: 14px; font-weight: bold;'>
                                    &nbsp;&nbsp;OLD LEADS :&nbsp;
                                    <asp:Label ID="lblOldLeads" runat="server"></asp:Label>&nbsp;&nbsp;
                                </span>|
                                <span style='color: #0000FF; font-size: 14px; font-weight: bold;'>
                                    &nbsp;&nbsp;TOTAL LEADS :&nbsp;
                                    <asp:Label ID="lblTotalLeads" runat="server"></asp:Label>&nbsp;&nbsp;
                                </span>|
                                <span style='color: #DF0101; font-size: 14px; font-weight: bold;'>
                                    &nbsp;&nbsp;USED LEADS :&nbsp;
                                    <asp:Label ID="lblUsedLeads" runat="server"></asp:Label>&nbsp;&nbsp;
                                </span>
                            </div>
                        </td>
                    </tr>
                </ContentTemplate>
            </asp:UpdatePanel>
        </table>
    </div>

    <script type="text/javascript">


        function SubmitConfirm() {
            var _retVal = false;
            _retVal = confirm('Are you sure to proceed UPDATE?');
            return _retVal;
        }

    </script>

</asp:Content>
